﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BabyToys.Models;

namespace BabyToys.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/
        DatabaseContext db = new DatabaseContext();
        public ActionResult Index()
        {
            var sanphams = db.SanPhams.ToList().OrderByDescending(s => s.IdSanPham).Take(6);
            return View(sanphams);
        }

        [ChildActionOnly]
        public ActionResult ModuleDanhMuc()
        {
            //ViewBag.DanhMuc = db.DanhMucs.ToList();
            return PartialView(db.DanhMucs.ToList());
        }
        [ChildActionOnly]
        public ActionResult ModuleTaiKhoan()
        {
            //ViewBag.DanhMuc = db.DanhMucs.ToList();
            return PartialView();
        }

    }
}
